import { parseHtml } from '.'
import { getList } from '../const/subApps'

export const prefetch = async () => {
  // 获取到所有的子应用列表 - 不包括当前正在显示的
  const appList = getList().filter(app => !window.location.pathname.startsWith(app.activeRule))
  // 预加载剩下的所有子应用
  await Promise.all(appList.map(app => parseHtml(app.entry, app.name)))
}
